<template>
  <tr>
    <td><input type="checkbox" v-model="item.checked" /></td>
    <td>{{ item.name }}</td>
    <td>{{ item.price }}</td>
    <td>
      <button @click="item.num <= 0 || item.num--">-</button>{{ item.num
      }}<button @click="item.num++">+</button>
    </td>
    <td>{{ item.price * item.num }}</td>
    <td><button @click="delFn">删除</button></td>
  </tr>
</template>

<script>
export default {
  props: ["item", "index", "t"],
  data() {
    return {};
  },
  methods: {
    delFn() {
      this.$emit("delFn", this.index);
    },
  },
};
</script>

<style>
</style>